package top.lixunda.ecommerce.server.good.api.entity.db;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品收藏
 * </p>
 *
 * @author Xumda
 * @since 2020-01-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("enshrine_goods")
@ApiModel(value="EnshrineGoodsDO对象", description="商品收藏")
public class EnshrineGoodsDO extends Model<EnshrineGoodsDO> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "唯一id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "收藏用户id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty(value = "用户名称")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "收藏的商品id")
    @TableField("good_id")
    private Integer goodId;

    @ApiModelProperty(value = "收藏的商品名称")
    @TableField("good_name")
    private String goodName;

    @ApiModelProperty(value = "收藏时间")
    @TableField("time")
    private LocalDateTime time;

    @ApiModelProperty(value = "逻辑删除")
    @TableField("useable")
    @TableLogic
    @JsonIgnore
    private Integer useable;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
